package com.xique.client.controller;

import com.xique.client.bean.request.ClientChangePasswordRequest;
import com.xique.client.bean.request.ClientRelieveRequest;
import com.xique.client.service.biz.service.IClientLoginBizService;
import com.xique.common.core.web.controller.BaseController;
import com.xique.common.core.web.domain.AjaxResult;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author shd
 * @create 2021/7/21 9:33
 */
@RestController
@RequestMapping("/login")
public class ClientLoginController extends BaseController {

    @Autowired
    private IClientLoginBizService clientLoginBizService;

    /**
     * 换班登录
     * @author shd
     * @date 2021/7/31 16:20
     * @param request
     * @return com.xique.common.core.web.domain.AjaxResult
     */
    @PostMapping("relieve")
    @ApiOperation("换班登录")
    public AjaxResult relieve(@Validated @RequestBody ClientRelieveRequest request) {
        return clientLoginBizService.relieve(request);
    }

    /**
     * 修改密码
     * @author shd
     * @date 2021/7/31 16:33
     * @param request
     * @return com.xique.common.core.web.domain.AjaxResult
     */
    @PostMapping("changePassword")
    @ApiOperation("修改密码")
    public AjaxResult changePassword(@Validated @RequestBody ClientChangePasswordRequest request) {
        return clientLoginBizService.changePassword(request);
    }
}
